package Euler41;

import java.util.*;
import ReusableCode.*;

public class PandigitalPrime {

	public static void main(String[] args) {
		System.out.println("Working...");
		List<Long> primes = new ArrayList<Long>();
		List<Long> perms = MathFunctions.getNumberPermutations(1234567);
		
		for (int i = 0; i < perms.size(); i++)
		{
			long num = perms.get(i);
			
			if(PrimeFunctions.isPrime(num))
			{
				primes.add(num);
			}
		}
		
		System.out.println(Collections.max(primes));
		//System.out.println(primes);
		//System.out.println(perms.size());
		
	}
}
